#include <iostream>
#include <string>
#include <cmath>

using namespace std;

void YieldToMaturity()
{
    //Start Code

    double c;       //Coupon/interest Payment
    double f;       //Face Value
    double p;       //Price 
    double n;       //years to maturity
    double nominator;
    double denominator;
    
    cout << "This Calculator will calculate the Approximate Yield to Maturity for a Bond" <<endl;
    cout << "Function written by Robinson Lenis from CIS 3100 - Baruch College" <<endl<<endl;
    cout << "Please enter the Coupon / Interest Payment: " <<endl;
    cin >> c;
    cout << "Please enter the Face Value: " <<endl;
    cin >> f;
    cout << "Please enter the Price:  " <<endl;
    cin >> p;
    cout << "Please enter the years to maturity: " <<endl<<endl;
    cin >> n;
    nominator = c+((f-p)/n);
    denominator =(f+p)/2;
    cout << "The Approxiamte Yield To Maturity is : " << nominator / denominator << endl;

	system("PAUSE");
}